/*
 * Copyright (c) 2012 by Paweł Lebioda <pawel.lebioda89@gmail.com>
 *
 * This file is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */
#ifndef _RANDOM_H
#define _RANDOM_H

#define RANDOM_MODE_GLOBAL	0
#define RANDOM_MODE_LOCAL	1	

struct random_interval 
{
	int min;
	int max;
};

struct random_type 
{
	struct random_interval interval;
	int size;
};


#define RANDOM_IOC_MAGIC		('r'^'a'^'n'^'d'^'o'^'m')

#define RANDOM_IO(nr)			_IO(RANDOM_IOC_MAGIC,nr)
#define RANDOM_IOW(nr,datatype)		_IOW(RANDOM_IOC_MAGIC,nr,datatype)
#define RANDOM_IOR(nr,datatype)		_IOR(RANDOM_IOC_MAGIC,nr,datatype)
#define RANDOM_IOWR(nr,datatype)	_IOWR(RANDOM_IOC_MAGIC,nr,datatype)


#define RANDOM_IOC_RESET		RANDOM_IO(1)
#define RANDOM_IOC_SET_SIZE		RANDOM_IOW(2,int)
#define RANDOM_IOC_GET_SIZE		RANDOM_IOR(3,int)
#define RANDOM_IOC_SET_MIN		RANDOM_IOW(4,int)
#define RANDOM_IOC_GET_MIN		RANDOM_IOR(5,int)
#define RANDOM_IOC_SET_MAX		RANDOM_IOW(6,int)
#define RANDOM_IOC_GET_MAX		RANDOM_IOR(7,int)
#define RANDOM_IOC_SET_CORE		RANDOM_IOW(8,int)
#define RANDOM_IOC_GET_CORE		RANDOM_IOR(9,int)
#define RANDOM_IOC_MODE_LOCAL		RANDOM_IO(10)	
#define RANDOM_IOC_MODE_GLOBAL		RANDOM_IO(11)
#define RANDOM_IOC_SET_MODE		RANDOM_IOW(12,int)
#define RANDOM_IOC_GET_MODE		RANDOM_IOR(13,int)
#define RANDOM_IOC_SET_INTERVAL		RANDOM_IOW(14,struct random_interval)
#define RANDOM_IOC_GET_INTERVAL		RANDOM_IOR(15,struct random_interval)
#define RANDOM_IOC_SET_TYPE		RANDOM_IOW(16,struct random_type)
#define RANDOM_IOC_GET_TYPE		RANDOM_IOR(17,struct random_type)

#define RANDOM_IOC_MAX			17

#endif //_RANDOM_H
